package com.qinggeng.project.system.controller;

import com.qinggeng.common.utils.poi.ExcelUtil;
import com.qinggeng.framework.aspectj.lang.annotation.Log;
import com.qinggeng.framework.aspectj.lang.enums.BusinessType;
import com.qinggeng.framework.web.controller.BaseController;
import com.qinggeng.framework.web.domain.AjaxResult;
import com.qinggeng.framework.web.page.TableDataInfo;
import com.qinggeng.project.api.dto.GoodsClassifyDTO;
import com.qinggeng.project.system.domain.GoodsClassify;
import com.qinggeng.project.system.domain.GoodsLower;
import com.qinggeng.project.system.domain.GoodsLowerClassify;
import com.qinggeng.project.system.dto.GoodsLowerClassifyDTO;
import com.qinggeng.project.system.service.IGoodsClassifyService;
import com.qinggeng.project.system.service.IGoodsLowerClassifyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 商品分类信息Controller
 *
 * @author qinggeng
 * @date 2020-05-27
 */
@RestController
@RequestMapping("${systemPath}/lowerClassify")
public class GoodsLowerClassifyController extends BaseController {

    @Autowired
    private IGoodsLowerClassifyService goodsLowerClassifyService;

    /**
     * 修改商品分类信息
     */
    @PreAuthorize("@ss.hasPermi('system:classify:edit')")
    @PutMapping
    public AjaxResult edit(@RequestBody GoodsLowerClassifyDTO dto) {
        goodsLowerClassifyService.updateGoodsLowerClassify(dto);
        return AjaxResult.success();
    }



    //增加商品
    @PreAuthorize("@ss.hasPermi('system:classify:add')")
    @PostMapping
    public AjaxResult add(@RequestBody GoodsLowerClassifyDTO dto) {
        goodsLowerClassifyService.addGoodsLowerClassify(dto);
        return AjaxResult.success();
    }

}
